package com.lframework.xingyun.basedata.vo.product.spu;

import com.lframework.starter.web.vo.BaseVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

@Data
public class UpdateProductSpuItemVo implements BaseVo, Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * SKUID
     */
    @ApiModelProperty(value = "SKUID", required = true)
    @NotBlank(message = "SKUID不能为空！")
    private String id;

    /**
     * 商品SKU编号
     */
    @ApiModelProperty(value = "商品SKU编号", required = true)
    @NotBlank(message = "商品SKU编号不能为空！")
    private String skuCode;

    /**
     * 外部编号
     */
    @ApiModelProperty("外部编号")
    private String externalCode;

    /**
     * 单位
     */
    @ApiModelProperty("单位")
    private String unit;

    /**
     * 进项税率（%）
     */
    @ApiModelProperty(value = "进项税率（%）")
    @Min(value = 0, message = "进项税率（%）不允许小于0！")
    @Digits(integer = 10, fraction = 0, message = "进项税率（%）必须为整数！")
    private BigDecimal taxRate = BigDecimal.ZERO;

    /**
     * 销项税率（%）
     */
    @ApiModelProperty(value = "销项税率（%）")
    @Min(value = 0, message = "销项税率（%）不允许小于0！")
    @Digits(integer = 10, fraction = 0, message = "销项税率（%）必须为整数！")
    private BigDecimal saleTaxRate = BigDecimal.ZERO;

    /**
     * 采购价
     */
    @NotNull(message = "采购价不能为空！")
    @ApiModelProperty("采购价")
    private BigDecimal purchasePrice = BigDecimal.ZERO;

    /**
     * 销售价
     */
    @NotNull(message = "销售价不能为空！")
    @ApiModelProperty("销售价")
    private BigDecimal salePrice;

    /**
     * 零售价
     */
    @NotNull(message = "零售价不能为空！")
    @ApiModelProperty("零售价")
    private BigDecimal retailPrice;

    /**
     * SKU多属性（ID逗号拼接）
     */
    @ApiModelProperty(value = "SKU多属性（ID逗号拼接）")
    private String skuPropertys;

    /**
     * SKU多属性（名称）
     */
    @ApiModelProperty(value = "SKU多属性（名称）")
    private String skuPropertysStr;

    /**
     * 状态
     */
    @ApiModelProperty(value = "状态",required = true)
    @NotNull(message = "状态不能为空！")
    private Boolean available;

}
